/**
 * <copyright>
 * </copyright>
 *

 */
package org.xtext.example.cr.cR.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.xtext.example.cr.cR.Array;
import org.xtext.example.cr.cR.ArrayElement;
import org.xtext.example.cr.cR.CRPackage;
import org.xtext.example.cr.cR.CalcCR;
import org.xtext.example.cr.cR.CalcMean;
import org.xtext.example.cr.cR.FindSimilar;
import org.xtext.example.cr.cR.SimpleVariable;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Find Similar</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getFunction <em>Function</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getMatrix <em>Matrix</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getIndxInt <em>Indx Int</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getIndxVar <em>Indx Var</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getIndxAE <em>Indx AE</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getSimilarityNum <em>Similarity Num</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getSimilarityVar <em>Similarity Var</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getSimilarityAE <em>Similarity AE</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getSimilarityCalcCR <em>Similarity Calc CR</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.FindSimilarImpl#getSimilarityCalcMean <em>Similarity Calc Mean</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FindSimilarImpl extends MinimalEObjectImpl.Container implements FindSimilar
{
  /**
   * The default value of the '{@link #getFunction() <em>Function</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFunction()
   * @generated
   * @ordered
   */
  protected static final String FUNCTION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getFunction() <em>Function</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFunction()
   * @generated
   * @ordered
   */
  protected String function = FUNCTION_EDEFAULT;

  /**
   * The cached value of the '{@link #getMatrix() <em>Matrix</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getMatrix()
   * @generated
   * @ordered
   */
  protected Array matrix;

  /**
   * The default value of the '{@link #getIndxInt() <em>Indx Int</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getIndxInt()
   * @generated
   * @ordered
   */
  protected static final int INDX_INT_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getIndxInt() <em>Indx Int</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getIndxInt()
   * @generated
   * @ordered
   */
  protected int indxInt = INDX_INT_EDEFAULT;

  /**
   * The cached value of the '{@link #getIndxVar() <em>Indx Var</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getIndxVar()
   * @generated
   * @ordered
   */
  protected SimpleVariable indxVar;

  /**
   * The cached value of the '{@link #getIndxAE() <em>Indx AE</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getIndxAE()
   * @generated
   * @ordered
   */
  protected ArrayElement indxAE;

  /**
   * The cached value of the '{@link #getSimilarityNum() <em>Similarity Num</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSimilarityNum()
   * @generated
   * @ordered
   */
  protected org.xtext.example.cr.cR.Number similarityNum;

  /**
   * The cached value of the '{@link #getSimilarityVar() <em>Similarity Var</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSimilarityVar()
   * @generated
   * @ordered
   */
  protected SimpleVariable similarityVar;

  /**
   * The cached value of the '{@link #getSimilarityAE() <em>Similarity AE</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSimilarityAE()
   * @generated
   * @ordered
   */
  protected ArrayElement similarityAE;

  /**
   * The cached value of the '{@link #getSimilarityCalcCR() <em>Similarity Calc CR</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSimilarityCalcCR()
   * @generated
   * @ordered
   */
  protected CalcCR similarityCalcCR;

  /**
   * The cached value of the '{@link #getSimilarityCalcMean() <em>Similarity Calc Mean</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSimilarityCalcMean()
   * @generated
   * @ordered
   */
  protected CalcMean similarityCalcMean;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected FindSimilarImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return CRPackage.Literals.FIND_SIMILAR;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getFunction()
  {
    return function;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFunction(String newFunction)
  {
    String oldFunction = function;
    function = newFunction;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__FUNCTION, oldFunction, function));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Array getMatrix()
  {
    if (matrix != null && matrix.eIsProxy())
    {
      InternalEObject oldMatrix = (InternalEObject)matrix;
      matrix = (Array)eResolveProxy(oldMatrix);
      if (matrix != oldMatrix)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, CRPackage.FIND_SIMILAR__MATRIX, oldMatrix, matrix));
      }
    }
    return matrix;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Array basicGetMatrix()
  {
    return matrix;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setMatrix(Array newMatrix)
  {
    Array oldMatrix = matrix;
    matrix = newMatrix;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__MATRIX, oldMatrix, matrix));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getIndxInt()
  {
    return indxInt;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setIndxInt(int newIndxInt)
  {
    int oldIndxInt = indxInt;
    indxInt = newIndxInt;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__INDX_INT, oldIndxInt, indxInt));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable getIndxVar()
  {
    if (indxVar != null && indxVar.eIsProxy())
    {
      InternalEObject oldIndxVar = (InternalEObject)indxVar;
      indxVar = (SimpleVariable)eResolveProxy(oldIndxVar);
      if (indxVar != oldIndxVar)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, CRPackage.FIND_SIMILAR__INDX_VAR, oldIndxVar, indxVar));
      }
    }
    return indxVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable basicGetIndxVar()
  {
    return indxVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setIndxVar(SimpleVariable newIndxVar)
  {
    SimpleVariable oldIndxVar = indxVar;
    indxVar = newIndxVar;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__INDX_VAR, oldIndxVar, indxVar));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ArrayElement getIndxAE()
  {
    return indxAE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetIndxAE(ArrayElement newIndxAE, NotificationChain msgs)
  {
    ArrayElement oldIndxAE = indxAE;
    indxAE = newIndxAE;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__INDX_AE, oldIndxAE, newIndxAE);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setIndxAE(ArrayElement newIndxAE)
  {
    if (newIndxAE != indxAE)
    {
      NotificationChain msgs = null;
      if (indxAE != null)
        msgs = ((InternalEObject)indxAE).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__INDX_AE, null, msgs);
      if (newIndxAE != null)
        msgs = ((InternalEObject)newIndxAE).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__INDX_AE, null, msgs);
      msgs = basicSetIndxAE(newIndxAE, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__INDX_AE, newIndxAE, newIndxAE));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public org.xtext.example.cr.cR.Number getSimilarityNum()
  {
    return similarityNum;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetSimilarityNum(org.xtext.example.cr.cR.Number newSimilarityNum, NotificationChain msgs)
  {
    org.xtext.example.cr.cR.Number oldSimilarityNum = similarityNum;
    similarityNum = newSimilarityNum;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_NUM, oldSimilarityNum, newSimilarityNum);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSimilarityNum(org.xtext.example.cr.cR.Number newSimilarityNum)
  {
    if (newSimilarityNum != similarityNum)
    {
      NotificationChain msgs = null;
      if (similarityNum != null)
        msgs = ((InternalEObject)similarityNum).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_NUM, null, msgs);
      if (newSimilarityNum != null)
        msgs = ((InternalEObject)newSimilarityNum).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_NUM, null, msgs);
      msgs = basicSetSimilarityNum(newSimilarityNum, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_NUM, newSimilarityNum, newSimilarityNum));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable getSimilarityVar()
  {
    if (similarityVar != null && similarityVar.eIsProxy())
    {
      InternalEObject oldSimilarityVar = (InternalEObject)similarityVar;
      similarityVar = (SimpleVariable)eResolveProxy(oldSimilarityVar);
      if (similarityVar != oldSimilarityVar)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, CRPackage.FIND_SIMILAR__SIMILARITY_VAR, oldSimilarityVar, similarityVar));
      }
    }
    return similarityVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable basicGetSimilarityVar()
  {
    return similarityVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSimilarityVar(SimpleVariable newSimilarityVar)
  {
    SimpleVariable oldSimilarityVar = similarityVar;
    similarityVar = newSimilarityVar;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_VAR, oldSimilarityVar, similarityVar));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ArrayElement getSimilarityAE()
  {
    return similarityAE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetSimilarityAE(ArrayElement newSimilarityAE, NotificationChain msgs)
  {
    ArrayElement oldSimilarityAE = similarityAE;
    similarityAE = newSimilarityAE;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_AE, oldSimilarityAE, newSimilarityAE);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSimilarityAE(ArrayElement newSimilarityAE)
  {
    if (newSimilarityAE != similarityAE)
    {
      NotificationChain msgs = null;
      if (similarityAE != null)
        msgs = ((InternalEObject)similarityAE).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_AE, null, msgs);
      if (newSimilarityAE != null)
        msgs = ((InternalEObject)newSimilarityAE).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_AE, null, msgs);
      msgs = basicSetSimilarityAE(newSimilarityAE, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_AE, newSimilarityAE, newSimilarityAE));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CalcCR getSimilarityCalcCR()
  {
    return similarityCalcCR;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetSimilarityCalcCR(CalcCR newSimilarityCalcCR, NotificationChain msgs)
  {
    CalcCR oldSimilarityCalcCR = similarityCalcCR;
    similarityCalcCR = newSimilarityCalcCR;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR, oldSimilarityCalcCR, newSimilarityCalcCR);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSimilarityCalcCR(CalcCR newSimilarityCalcCR)
  {
    if (newSimilarityCalcCR != similarityCalcCR)
    {
      NotificationChain msgs = null;
      if (similarityCalcCR != null)
        msgs = ((InternalEObject)similarityCalcCR).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR, null, msgs);
      if (newSimilarityCalcCR != null)
        msgs = ((InternalEObject)newSimilarityCalcCR).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR, null, msgs);
      msgs = basicSetSimilarityCalcCR(newSimilarityCalcCR, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR, newSimilarityCalcCR, newSimilarityCalcCR));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public CalcMean getSimilarityCalcMean()
  {
    return similarityCalcMean;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetSimilarityCalcMean(CalcMean newSimilarityCalcMean, NotificationChain msgs)
  {
    CalcMean oldSimilarityCalcMean = similarityCalcMean;
    similarityCalcMean = newSimilarityCalcMean;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN, oldSimilarityCalcMean, newSimilarityCalcMean);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSimilarityCalcMean(CalcMean newSimilarityCalcMean)
  {
    if (newSimilarityCalcMean != similarityCalcMean)
    {
      NotificationChain msgs = null;
      if (similarityCalcMean != null)
        msgs = ((InternalEObject)similarityCalcMean).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN, null, msgs);
      if (newSimilarityCalcMean != null)
        msgs = ((InternalEObject)newSimilarityCalcMean).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN, null, msgs);
      msgs = basicSetSimilarityCalcMean(newSimilarityCalcMean, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN, newSimilarityCalcMean, newSimilarityCalcMean));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case CRPackage.FIND_SIMILAR__INDX_AE:
        return basicSetIndxAE(null, msgs);
      case CRPackage.FIND_SIMILAR__SIMILARITY_NUM:
        return basicSetSimilarityNum(null, msgs);
      case CRPackage.FIND_SIMILAR__SIMILARITY_AE:
        return basicSetSimilarityAE(null, msgs);
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR:
        return basicSetSimilarityCalcCR(null, msgs);
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN:
        return basicSetSimilarityCalcMean(null, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case CRPackage.FIND_SIMILAR__FUNCTION:
        return getFunction();
      case CRPackage.FIND_SIMILAR__MATRIX:
        if (resolve) return getMatrix();
        return basicGetMatrix();
      case CRPackage.FIND_SIMILAR__INDX_INT:
        return getIndxInt();
      case CRPackage.FIND_SIMILAR__INDX_VAR:
        if (resolve) return getIndxVar();
        return basicGetIndxVar();
      case CRPackage.FIND_SIMILAR__INDX_AE:
        return getIndxAE();
      case CRPackage.FIND_SIMILAR__SIMILARITY_NUM:
        return getSimilarityNum();
      case CRPackage.FIND_SIMILAR__SIMILARITY_VAR:
        if (resolve) return getSimilarityVar();
        return basicGetSimilarityVar();
      case CRPackage.FIND_SIMILAR__SIMILARITY_AE:
        return getSimilarityAE();
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR:
        return getSimilarityCalcCR();
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN:
        return getSimilarityCalcMean();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case CRPackage.FIND_SIMILAR__FUNCTION:
        setFunction((String)newValue);
        return;
      case CRPackage.FIND_SIMILAR__MATRIX:
        setMatrix((Array)newValue);
        return;
      case CRPackage.FIND_SIMILAR__INDX_INT:
        setIndxInt((Integer)newValue);
        return;
      case CRPackage.FIND_SIMILAR__INDX_VAR:
        setIndxVar((SimpleVariable)newValue);
        return;
      case CRPackage.FIND_SIMILAR__INDX_AE:
        setIndxAE((ArrayElement)newValue);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_NUM:
        setSimilarityNum((org.xtext.example.cr.cR.Number)newValue);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_VAR:
        setSimilarityVar((SimpleVariable)newValue);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_AE:
        setSimilarityAE((ArrayElement)newValue);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR:
        setSimilarityCalcCR((CalcCR)newValue);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN:
        setSimilarityCalcMean((CalcMean)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case CRPackage.FIND_SIMILAR__FUNCTION:
        setFunction(FUNCTION_EDEFAULT);
        return;
      case CRPackage.FIND_SIMILAR__MATRIX:
        setMatrix((Array)null);
        return;
      case CRPackage.FIND_SIMILAR__INDX_INT:
        setIndxInt(INDX_INT_EDEFAULT);
        return;
      case CRPackage.FIND_SIMILAR__INDX_VAR:
        setIndxVar((SimpleVariable)null);
        return;
      case CRPackage.FIND_SIMILAR__INDX_AE:
        setIndxAE((ArrayElement)null);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_NUM:
        setSimilarityNum((org.xtext.example.cr.cR.Number)null);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_VAR:
        setSimilarityVar((SimpleVariable)null);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_AE:
        setSimilarityAE((ArrayElement)null);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR:
        setSimilarityCalcCR((CalcCR)null);
        return;
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN:
        setSimilarityCalcMean((CalcMean)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case CRPackage.FIND_SIMILAR__FUNCTION:
        return FUNCTION_EDEFAULT == null ? function != null : !FUNCTION_EDEFAULT.equals(function);
      case CRPackage.FIND_SIMILAR__MATRIX:
        return matrix != null;
      case CRPackage.FIND_SIMILAR__INDX_INT:
        return indxInt != INDX_INT_EDEFAULT;
      case CRPackage.FIND_SIMILAR__INDX_VAR:
        return indxVar != null;
      case CRPackage.FIND_SIMILAR__INDX_AE:
        return indxAE != null;
      case CRPackage.FIND_SIMILAR__SIMILARITY_NUM:
        return similarityNum != null;
      case CRPackage.FIND_SIMILAR__SIMILARITY_VAR:
        return similarityVar != null;
      case CRPackage.FIND_SIMILAR__SIMILARITY_AE:
        return similarityAE != null;
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_CR:
        return similarityCalcCR != null;
      case CRPackage.FIND_SIMILAR__SIMILARITY_CALC_MEAN:
        return similarityCalcMean != null;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (function: ");
    result.append(function);
    result.append(", indxInt: ");
    result.append(indxInt);
    result.append(')');
    return result.toString();
  }

} //FindSimilarImpl
